

use $datapath/clean/main_data.dta, clear 


************************
** decline in visits due to ebooks existing

areg visits Np Ne i.year, absorb(lno) vce(robust)
	gen bfe=_b[Ne]
	su Ne  if year==2018
	local m=r(mean)*r(N) 

	su visits if year==2018
	local v=r(mean)*r(N) 

	gen decline_fe = `m'*bfe/`v'

************************
** decline in visits between 2013 and 2018
	
	areg visits i.year, absorb(lno)
		local dv = _b[2018.year]
		
	areg Ne i.year, absorb(lno)
		local dn = _b[2018.year]
		
	gen decline_1318 = `dn'*bfe / `dv'
	su decline*
	
	
************************
** Decline in visits

	areg visits i.year, absorb(lno)
		di _b[2018.year] / _b[_cons]




